import Vue from 'vue'
import Router from 'vue-router'
import login from '%/login'
import home from '%/home'
import folder from '%/home/folder'
import page from '%/page'
import demo from '%/demo'
import Bus from '@/bus/bus';
Vue.use(Router)
let router = new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    }, {
      path: '/home/',
      name: 'home',
      component: home,
      children: [{
        path: ':fid',
        name: 'folder',
        component: folder,
      }, {
        path: 'file/:eid',
        name: 'page',
        component: page,
      }]
    },
    {
      path: '/demo',
      name: 'demo',
      component: demo
    }
  ],
  beforeEach() {
    console.log('切换')
  }
})

export default router
